home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / misc1 / iv26_w30.zip / INTERVIE / GRAPHIC / ELLIPSES.H < prev    next >
C/C++ Source or Header  |  1991-12-10  |  3KB  |  110 lines

  1. /*
  2.  * Copyright (c) 1987, 1988, 1989 Stanford University
  3.  *
  4.  * Permission to use, copy, modify, distribute, and sell this software and its
  5.  * documentation for any purpose is hereby granted without fee, provided
  6.  * that the above copyright notice appear in all copies and that both that
  7.  * copyright notice and this permission notice appear in supporting
  8.  * documentation, and that the name of Stanford not be used in advertising or
  9.  * publicity pertaining to distribution of the software without specific,
  10.  * written prior permission.  Stanford makes no representations about
  11.  * the suitability of this software for any purpose.  It is provided "as is"
  12.  * without express or implied warranty.
  13.  *
  14.  * STANFORD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  15.  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
  16.  * IN NO EVENT SHALL STANFORD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  17.  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  18.  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  19.  * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
  20.  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  21.  */
  22.  
  23. /*
  24.  * Interface to Ellipses and Circles, objects derived from Graphic.
  25.  */
  26.  
  27. #ifndef ellipses_h
  28. #define ellipses_h
  29.  
  30. #include <InterViews/Graphic/base.h>
  31.  
  32. class GEllipse : public Graphic {
  33. public:
  34.     GEllipse();
  35.     GEllipse(Coord x0, Coord y0, int r1, int r2, Graphic* gr = nil);
  36.     ~GEllipse();
  37.  
  38.     void GetOriginal(Coord&, Coord&, int&, int&);
  39.  
  40.     virtual void SetBrush(PBrush*);
  41.     virtual PBrush* GetBrush();
  42.     virtual void SetPattern(PPattern*);
  43.     virtual PPattern* GetPattern();
  44.  
  45.     virtual Graphic* Copy();
  46.     virtual ClassId GetClassId();
  47.     virtual boolean IsA(ClassId);
  48. protected:
  49.     virtual void getExtent(float&, float&, float&, float&, float&, Graphic*);
  50.     virtual boolean contains(PointObj&, Graphic*);
  51.     virtual boolean intersects(BoxObj&, Graphic*);
  52.     virtual void draw(Canvas*, Graphic*);
  53.  
  54.     virtual void pat(Ref);
  55.     virtual Ref pat();
  56.     virtual void br(Ref);
  57.     virtual Ref br();
  58.  
  59.     virtual boolean read(PFile*);
  60.     virtual boolean write(PFile*);
  61. protected:
  62.     Ref _patbr;
  63.     Coord x0, y0;
  64.     int r1, r2;
  65. };
  66.  
  67. class FillEllipse : public GEllipse {
  68. public:
  69.     FillEllipse();
  70.     FillEllipse(Coord x0, Coord y0, int r1, int r2, Graphic* gr = nil);
  71.  
  72.     virtual void SetBrush(PBrush*);
  73.  
  74.     virtual Graphic* Copy();
  75.     virtual ClassId GetClassId();
  76.     virtual boolean IsA(ClassId);
  77. protected:
  78.     virtual void getExtent(float&, float&, float&, float&, float&, Graphic*);
  79.     virtual boolean contains(PointObj&, Graphic*);
  80.     virtual boolean intersects(BoxObj&, Graphic*);
  81.     virtual void draw(Canvas*, Graphic*);
  82.  
  83.     virtual void pat(Ref);
  84.     virtual Ref pat();
  85.     virtual void br(Ref);
  86.     virtual Ref br();
  87. };
  88.  
  89. class Circle : public GEllipse {
  90. public:
  91.     Circle();
  92.     Circle(Coord x0, Coord y0, int radius, Graphic* gr = nil);
  93.  
  94.     virtual Graphic* Copy();
  95.     virtual ClassId GetClassId();
  96.     virtual boolean IsA(ClassId);
  97. };
  98.  
  99. class FillCircle : public FillEllipse {
  100. public:
  101.     FillCircle();
  102.     FillCircle(Coord x0, Coord y0, int radius, Graphic* gr = nil);
  103.  
  104.     virtual Graphic* Copy();
  105.     virtual ClassId GetClassId();
  106.     virtual boolean IsA(ClassId);
  107. };
  108.  
  109. #endif
  110.